<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<meta name="keywords" content="微雨" />
	<meta name="description" content="微雨-基于声音的社交应用" />
	<title>微雨-基于声音的社交应用</title>
	<script type="text/javascript" src="js/jquery172.js"></script>
	<script src="js/jdialog.js" type="text/javascript"></script>
	<link rel="stylesheet" type="text/css" href="css/weiyu.css" />
	<link rel="stylesheet" type="text/css" href="http://style.025.com/css/module/popwin/popwin.css"/>
	<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
	<script type="text/javascript" src="/js/onscroll.js"></script>
	<script type="text/javascript">
	var vid; 
    $(function(){
        vid = queryStr("vid");
        
        // $.getJSON( '/voice.aspx?act=voicedetail&vid='+vid, function(data) {
        // 	if(data.code==1001){
        // 		alert('非常抱歉！该语音已被删除')
        // 	}else{
        // 		setParam(data);
        //    		getComments(1,vid);
        // 	}
        // });
        
        
    });	
    
    function getComments(pageindex,vid)
    {
        $.getJSON("/voice.aspx?act=getcomment&pageindex="+pageindex+"&vid="+vid,function(data){
        	//alert(data)
            arrDiscuss = data;
            addMsg(data);
        });
    }
    
    var arrDiscuss=[];
	
	</script>
</head>
<body >
	<div class="wrap ">
		<div class="header">
			<a class="logo" href="main.html" target="_blank">微雨</a>
			<span class="title">基于声音的社交应用</span>
		</div>
		<div class="banner bg1">
			<div class="app_box">
				<!-- 登陆 -->
				<div class="login_box">
					<!-- <a class="ioginsn"></a>
					<a class="ioginqq"></a> -->
					<!-- <a class="ioginsn_ed"></a>
					<a class="ioginqq_ed"></a> -->
				</div>
				<!-- 歌词 -->
				<div class="lcr_box">
					<!-- 歌名&喜欢 -->
					<div class="title">
						<!-- <div class="fn_right shenqu"></div> -->
						<!-- <div class="fn_right shenqu_ed">333</div> -->
						<!-- <div class="fn_right loveit " title="I love it">
							55
						</div> -->
						<!-- <div class="fn_right loveit_ed" title="I love it">
							555+
						</div> -->
					</div>
					<!-- 歌词 -->
					<div class="lcrs">
						<div class='lcrs_str'>
						<p></p>
						</div>
					</div>	
				</div>
				<!-- 某人的呻吟 -->
				<div class="playsomeone">
					<!-- 播放盒子1 -->
					<div class="fn_right misuc_box2" url='#' long=''>
						<a class="fn_right play"></a>
						<span class='timedic'></span>
						<span class="misuc_boxover"></span>
					</div>
					<!-- 进度条 -->

					<div class="speed_box">
						<div class="speeds" ></div>
					</div>
					<!-- <p>
						<span class="fn_right playNum">11次播放</span>
						<span class='v_time' >2012-11-25</span>
					</p> -->

					<div class="user">
						<a class="fn_right seed_m carton" target="_blank">下载客户端吧</a>
						<span class="age"></span>
						<span class='nickname'></span>
						<p>
							<span class='v_time' ></span>
						</p>
					</div>
					<div class="Scoreboard">
						<ul>
							<li>喜欢<br><span class="loveit">1404</span></li>
							<li>神曲<br><span class="shenqu">4545</span></li>
							<li>赏分<br><span class="shangfen">4545</span></li>
							<li style="line-height:44px ;">分享<br>
							<!-- <span class="share">23</span> -->
							</li>
						</ul>
					</div>
					<!-- 录制呻吟的盒子 -->
					<div class="seed_box">
						<a class="carton" target="_blank">下载客户端吧</a>
						<input type="text" placeholder="说点什么..." />
						<a class="carton" target="_blank">下载客户端吧</a>
					</div>
				</div>
				<p class="title_b">
					想回应？<a href="main.html" target="_blank">下载客户端吧</a>
				</p>
				<ul class="others">
				</ul>
				<a class="more_others">加载更多评论</a>
			</div>
		</div>

		<div class="footer shadow1">
			<p>
				<a href="main.html" target="_blank">关于微雨</a>
				<a href="http://www.duoyi.com/dycommerce/ch/about.html" target="_blank">关于多益</a>
				<a href="javascript:;" class="view_popwin" id="view_popwin">意见反馈</a>
			</p>
			<p class="copyright">广州多益网络科技有限公司<br/>
				<a href="http://www.miitbeian.gov.cn/state/outPortal/loginPortal.action" rel="noflow">ICP粤B2-20060723-4</a>
			</p>

		</div>
		<div id = 'Jq_player'>
			<audio id = 'Jq_audio' preload='metadata' src='#'></audio>
		</div>
	</div>
	<input class='text fn_hide_text' type='test'>
	<div style='top:-10000px;position:absolute'>
		<object id="FlashID" name="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" type="application/x-shockwave-flash">
		  <param name="movie" value="MusicPlayer.swf" />
		  <param name="FlashVars" value="url=#" />
		  <param name="quality" value="high" />
		  <param name="swfversion" value="8.0.35.0" />
		  <param name="allowScriptAccess" value="always" />
		  <param name="wmode" value="transparent" />
		  <param name="allowFullScreen" value="true" />
		  <embed src="MusicPlayer.swf" quality="high" wmode="transparent" width="800" height="600" id="FlashID" name="FlashID" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="url=#"
		/>
		</object>
	</div>
    <div class='flashurl' f_url=''></div>
 
<!-- 意见反馈 -->
<div id='ui_popwin' class="view ui_popwin " style="display:none">
	<div class=" w455">
		
		<div class="ui_popwin_con">
			<div class="w430 m0a">
				
				<dl class="input_box">
					<dt>问题描述：</dt>
					<dd class="inset_shadow">
						<textarea id="jycontent" title=""></textarea>
					</dd>
				</dl>
				<div class="ui_popwin_btn_r">
					<span class="text fn_right">客服热线：020-38029278</span>
					<input type="button" value="提交反馈" class="ui_button fn_left"></div>
			</div>
		</div>
	</div>
</div>
</body>
<script type='text/javascript'>
var FF = navigator.userAgent.toLowerCase().indexOf('firefox');
var Ie = navigator.userAgent.toLowerCase().indexOf('ie');
//请求
useFlash = (Ie>0)?true:false;
var btn;
// useFlash = false;
function setParam(arr){
	try{
		
		// alert(arr.songcontent)
		
		$('.v_time').html(arr.vtime);
		if(arr.sex == 1) $('.age').addClass('age_b');
		else $('.age').addClass('age_g');
		//年龄
		var NowDate = new Date();
		var B = arr.birthday.split("-");

		var DATASTR = new Date(arr.vtime.replace(/-/g,'/'));
		var year = DATASTR.getFullYear(),month = DATASTR.getMonth()+1,day = DATASTR.getDate();
		if(month<10) monthstr = '0'+ month;
		else monthstr= month;
		if(day<10) daystr = '0'+day;
		else daystr = day;
		vtimeStr = (year+"_"+monthstr+"/"+daystr);
		var wav = '/res/v/'+vtimeStr+'/'+vid+'.wav';
		var mp3 = '/voice.aspx?act=onlyvoice&path=/res/v/'+vtimeStr+'/'+vid+'&type=mp3&mm.mp3';
		$('.misuc_box2').attr({'wavurl':wav,'mp3url':mp3});
		age = (NowDate.getFullYear()-parseInt(B[0]));
		$('.age').html(age);
		$('.nickname').html(arr.nickname)
		// $('.playNum').html(arr.playnum+'次播放');
		$('.misuc_box2').attr('long',arr.vlong).find('.timedic').html(arr.vlong+'″');
		str = arr.desc;
		if(str == '为你录制的语音加点文字说明吧'){
			str='';
		}
		$('.lcrs_str p').html(str);//死肥仔
		upnumStr = (arr.upnum>999)?'999+':arr.upnum ;
		$('.loveit_ed').html(upnumStr);
		$(".lcrs").ready(function  (){//显示窗口层class
			$(".lcrs_str").oScroll({ //文本内容层class
			});
		})
	}catch(e){
		alert('非常抱歉！该语音已被删除');
	}
}
var s='';regArr='';
function Regexp(str){
	var regArr = str.match(/#\d*/g);
	if(regArr!=null){
		for(var i = 0 ; i < regArr.length ; i++){
			if(regArr[i].length>1){
				var regs = new RegExp(regArr[i],'g');
				num = regArr[i].substring(1);
				SRC = '/res/images/'+num+'.png';
				str=str.replace(regs,'<Img src="'+SRC+'" />');
			}
		}
	}
	return  str;
}


//调用评论



function addMsg(arrDiscuss){
	try{
	arr_Len = arrDiscuss.length ;
	if(arr_Len!=0){
		for(var i in arrDiscuss){
			if(arrDiscuss[i].havevoice == 1){
				//请求语音接口
				var DATASTR = new Date(arrDiscuss[i].commenttime.replace(/-/g,'/'));
				var year = DATASTR.getFullYear(),month = DATASTR.getMonth()+1,day = DATASTR.getDate();
				if(month<10) monthstr = '0'+ month;
				else monthstr= month;
				if(day<10) daystr = '0'+day;
				else daystr = day;
				vtimeStr = (year+"_"+monthstr+"/"+daystr);
				var DiscussStr = arrDiscuss[i].content;
				DiscussStr = Regexp(DiscussStr);
				var wav = '/res/v/'+vtimeStr+'/'+arrDiscuss[i].cguid+'.wav';
				var mp3 = '/voice.aspx?act=onlyvoice&path=/res/v/'+vtimeStr+'/'+arrDiscuss[i].cguid+'&type=mp3&mm.mp3';
				$('.others').append('\
					<li class="lastLi" style="display:none"><a href="" class="reply carton">回复</a>\
						<span>'+arrDiscuss[i].nickname+"："+DiscussStr+'</span>\
						<div class="misuc_box3 inline" long="'+arrDiscuss[i].vlong+'" mp3url='+mp3+' wavurl='+wav+' >\
							<a class="fn_right play"></a><span class="voice_time">'+arrDiscuss[i].vlong+'″</span>\
							<span class="misuc_boxover"></span>\
						</div>\
					</li>')
			}else{
				var DiscussStr = arrDiscuss[i].content;
				DiscussStr = Regexp(DiscussStr);
				$('.others').append('\
					<li class="lastLi"  style="display:none"><span class="time">'+arrDiscuss[i].commenttime+'</span>\
						<span>'+arrDiscuss[i].nickname+"："+DiscussStr+'</span>\
					</li>')
			}
			$('.lastLi').slideDown().removeClass('lastLi');
		}
	}else{
		$('.more_others').slideUp();
	}
	}catch(e){
		alert(e)
	}
}

var btn = false;


function userAgentFn(){
	var c;
	c = $('#Jq_audio').get(0);
	return c;
}
function mediaPLAYER_control(param){//播放控制
	obj = userAgentFn();
	switch (param){
		case 'play':obj.play();break;
		case 'pause':obj.pause();break;
		case 'stop':obj.stop();break;
	}
}
function percentControl(){//进度条控制
	obj = userAgentFn();
	now = obj.currentTime;
	all = obj.duration;
	return now;
}
function mediaChange(url){
	$('#Jq_audio').get(0).src = url;
}
function haveUrl(){//判断有无地址
	url = $('.flashurl').attr('f_url');
	return url.toString();
}

function ChangeSong(url){
	getPlayer("FlashID").ChangeSong(url);
}

function vociePlayStop(){
	getPlayer("FlashID").PlayStop();
}

function SoundEnd()
{
	$('.speeds').width(0);
	$('.playing').removeClass('playing').addClass('play');
	$('.misuc_box2').attr('play',false);
}

function getPlayer(movieName) {   
 	if (navigator.appName.indexOf("Microsoft") != -1) {//ie
        return document.getElementById(movieName);
    } else {//ff
        return document.embeds[movieName];  //document[movieName];
    } 
}
if(useFlash){
	function getPosition(s)
	{	
		if(btn){
			$('.speeds').width(s/100*$('.speed_box').width());
		}
	}
}
//
//动画
$('.carton').click(function(){
	var c = 180;

	function fuckU(call){

			var changeColer = setInterval(function(){
				c++;
				$('.title_b').css('backgroundColor','rgb('+c+',244,245)')
				if(c>=245){
					clearInterval(changeColer);
					$('.title_b').css('backgroundColor','rgb(245,245,245)');
					if(typeof call!='undefined'){
						call()
					}
					


				}
			},10)

	}
	fuckU(function(){
		fuckU();c = 180;
	});
	// setTimeout(function(){
	// 	$('.title_b').stop().animate({'background-color':'#f5f5f5'},100);
	// },100)

})




///////////////////////////////////////////////
var setPercent;
$('.misuc_box2').live('click',function(){
	//大按钮点击
	btn = true ;
	var thisurl;
	var self = $(this) ; 
	clearInterval(setPercent);//清楚定时器
	
	if(!useFlash){//非Flash
		var _url =  $(this).attr('wavurl');
		var nowUrl = haveUrl();
		if(nowUrl!=_url){
			mediaChange(_url);
			$('.flashurl').attr('f_url',_url);
		}
	}else{//flash
		var _url = $(this).attr('mp3url');
		var nowUrl = haveUrl();
		if(nowUrl!=_url){
			ChangeSong(_url);
			$('.flashurl').attr('f_url',_url);
		}
	}
		//所有播放按钮清除
	$('.playing').removeClass('playing').addClass('play');

	

	if($(this).attr('play')=='true'){//播放状态 ————>进入暂停状态
		$(this).attr('play',false);
		if(useFlash){
			// clearInterval(setPercent);
			// $('.speeds').width(0);
			vociePlayStop();
		}else{
			mediaPLAYER_control('pause');
		}
		$(this).find('a').removeClass('playing').addClass('play');
	}else{//停止状态  ————>进入播放状态
		all = parseInt($('.misuc_box2').attr('long'));
		if(useFlash){
			vociePlayStop();
		}else{
			mediaPLAYER_control('play');
			obj = userAgentFn();
			
			wp = percentControl()/all;
			setPercent = setInterval(function(){
				wp = percentControl()/all;
				// $('.timedic').html(parseInt(all)+'″');
				$('.text').val(percentControl());
				$('.speeds').width(wp*$('.speed_box').width());
				if(wp >= 1){
					self.attr('play',false).find('a').removeClass('playing').addClass('play');
					$('.speeds').width(0);
					clearInterval(setPercent);
				}
			},100)
		}
		$(this).attr('play',true);
		$(this).find('a').removeClass('play').addClass('playing');
	}
})
$('.misuc_box3').live('click',function(){	
	var self = $(this) ;
	btn = false ;
	clearInterval(setPercent);
	if(useFlash){
		var _url = $(this).attr('mp3url');
	}else{
		var _url = $(this).attr('wavurl');
	}
	$('.playing').removeClass('playing').addClass('play');

	$('.misuc_box2').attr('play',false);
	$('.misuc_box3').attr('play',false);

	if($(this).attr('play')=='true'){//播放状态 ————>进入暂停状态
		$(this).attr('play',false);
		if(useFlash){
			vociePlayStop();
		}else{
			mediaPLAYER_control('pause');
		}
		$(this).find('a').removeClass('playing').addClass('play');
	}else{
		if(!useFlash){
			var nowUrl = haveUrl();	
			if(nowUrl!=_url){
				mediaChange(_url);
			}
			mediaPLAYER_control('play');
			obj = userAgentFn();
			all = parseInt(self.attr('long'));
			// wp = percentControl()/all;
			var n = all ;
			setPercent = setInterval(function(){
				n--;
				if(n <= 0){
					self.attr('play',false).find('a').removeClass('playing').addClass('play');
					// mediaChange(_url);
					clearInterval(setPercent);
				}
			},1000)	
		}else{
			if($('.flashurl').attr('f_url')!=_url){
				ChangeSong(_url);
				$('.flashurl').attr('f_url',_url);
			}
			vociePlayStop();
			all = parseInt(self.attr('long'));
			var n = all ;
			setPercent = setInterval(function(){
				n--;
				if(n <= 0){
					self.attr('play',false).find('a').removeClass('playing').addClass('play');
					$('.speeds').width(0);
					clearInterval(setPercent);
				}
			},1000)	
		}
		
		$(this).attr('play',true);
		$(this).find('a').removeClass('play').addClass('playing');
	}
	$('.flashurl').attr('f_url', _url)
});
page = 1;

$('.more_others').click(function(){
	getComments(++page,vid);
})
$(function(){
	//意见反馈
	$(".view_popwin").click(function(){
		var dialog = $.dialog({
		    content: document.getElementById('ui_popwin'),
		    title:'意见反馈'
		});$("#jycontent").val('');
		$('.ui_button').unbind('click').click(function(){
				jycontentStr = $("#jycontent").val();
				if(jycontentStr!=''){
					$.getJSON( '/sets.aspx?act=feedback&feed='+jycontentStr, function(data) {alert('反馈成功');});
				}else{
					alert('请输入您要反馈的内容');
					return false;
				}
				dialog.close();
		})
	});
});
</script>
</html>